<!--
 * @Description: 开始节点
-->
<template>
  <div class="nodeBegin">
    <Form
      :model="G_formItem"
      :label-width="80"
      label-colon
      :disabled="G_baseDisabled"
      class="form"
    >
      <Row>
        <FormItem label="节点ID" class="formItem">
          <Input v-model="G_formItem.nodeID" placeholder="无内容" />
        </FormItem>
        <FormItem label="节点名称" class="formItem">
          <Input v-model="G_formItem.nodeName" placeholder="无内容" />
        </FormItem>
      </Row>
      <FormItem label="功能说明" class="formItem">
        <Input
          v-model="G_formItem.explain"
          type="textarea"
          :autosize="{ minRows: 2, maxRows: 5 }"
          placeholder="无内容"
        />
      </FormItem>
    </Form>
  </div>
</template>
<script lang="ts">
import { I_begin, Tsrv, T_srv, ts, ifs, vue } from '../config';

@T_srv.comp
export default class nodeBegin extends vue {
  @T_srv.prop({ type: Object }) params!: any;

  // 父组件compBoxInfo
  @T_srv.prop({
    required: false,
    type: Object,
    default: null
  })
  compBoxInfo: ifs.I_compBoxInfo;

  private GT_compBox: ifs.I_compBox;

  private G_compID: string;

  private GT_compBoxInfo: ifs.I_compBoxInfo;

  private G_baseDisabled: boolean = true;

  private G_formItem: I_begin = {
    type: 'beginNode',
    nodeID: '',
    nodeName: '开始',
    explain: '流程开始,一个规则流程图只能有一个开始节点。'
  };

  created() {
    this.G_compID = this.compBoxInfo.compID;
    this.GT_compBox = this.compBoxInfo.TcompBox;
    this.GT_compBoxInfo = { compID: this.G_compID, TcompBox: this.GT_compBox };

    if (this.params.data && this.params.data[`nodeID`]) {
      this.G_formItem.nodeID = this.params.data[`nodeID`];
    }
  }

  mounted() {
    this.GT_compBox.addCompMergeName(this.G_compID, 'nodeAttr_begin', this);
  }

  destroyed() {
    this.GT_compBox.removeCompMergeName(this.G_compID, 'nodeAttr_begin');
  }
}
</script>
<style scoped lang="scss">
.nodeBegin {
  height: 100%;
  width: 100%;

  padding-top: 5px;
  padding-bottom: 5px;
  border-top: 1px solid #a1a1b3;
  border-bottom: 1px solid #a1a1b3;
}
.formItem {
  margin-bottom: 5px;
}
.form {
  padding-top: 5px;
}
.fountColor {
  color: var(--default-hover-font-color);
}
</style>
